package Text6;

import java.util.*;

public class Main {
    static int N = 5000010;
    static int[] arr = new int[N];

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int T = in.nextInt();
        for (int Case = 1; Case <= T; Case++) {
            int n = in.nextInt();
            String s = in.next();
            for (int i = 0; i < n; i++) {
                arr[i + 1] = s.charAt(i) - '0';
                arr[i + 1] += arr[i];
            }
            int r = (n + 1) / 2, res = 0;
            for (int i = r; i <= n; i++) {
                res = Math.max(res, arr[i] - arr[i - r]);
            }
            System.out.printf("Case #%d: %d\n", Case, res);

        }

    }
}
